<?php
require_once '../../include/functions.php';
//set session save path
session_save_path("../../".$session_path);
// Initialize a session. 
session_start();
$count++;
$start = time();
$sessionId = session_id();
//Connect To Database
dbConnect();

$SQL = "SELECT ID, Score, Rank, PrevRank, PicksMade FROM NHLUsers ORDER BY Score DESC, Rank ASC, ID ASC";
//Open Record Set using SQL Query
$result = mysql_query($SQL) or die("Cannot query the database.<br/>");
?>

<br/>
<table width="550" cellpadding="5" cellspacing="0">
	<tr>
		<td align="center" class="redbg" height="1"><span class="whitelink"><?= date("Y"); ?> NHL User Standings By Straight SCORE</span></td>
	</tr>
	<tr>
		<td class="redbg">
		<table width="100%" cellspacing="0" cellpadding="3" border="0" align="center">
		<tr bgcolor="#FFFFFF">
			<TH width="5%">&nbsp;</TH>
			<TH width="30%" align="left">UserName</TH>
			<TH width="15%" align="left">Score</TH>
			<TH width="15%" align="left">Rank</TH>
			<TH width="15%" align="left">Previous Rank</TH>
		</tr>
		<tr bgcolor="#FFFFFF"><td colspan="5"><hr color="#cd0000" size="1"></td></tr>
	<?
	$num=0;
	do{
		if (($myrow["ID"] != Null) || ($myrow["ID"] != ""))
		{
			$num++;
			if ($userID && ($userID == $myrow["ID"]))
				echo "<tr bgcolor=\"#ffff33\">";
			else
				echo "<tr bgcolor=\"".getRowColor($num)."\">";
			echo "<td>&nbsp;</td><td valign=\"center\"><B>".makeUserLink($myrow["ID"])."</B></td><td>".$myrow["Score"]."</td><td>".$myrow["Rank"]."</td><td>".$myrow["PrevRank"]."</td></tr>";
		}
	}while($myrow = mysql_fetch_array($result));
?>	<tr bgcolor="#FFFFFF"><td colspan="5">&nbsp;</td></tr></table></td></tr>
</table>
